package com.gc.baselib.permission

import android.content.Context
import android.content.Intent
import android.net.Uri
import android.provider.Settings

class PermissionUtils {
    companion object{
        fun getAppSetting(context: Context): Intent {
            try {
                val intent = Intent()
                intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
                intent.action = Settings.ACTION_APPLICATION_DETAILS_SETTINGS
                intent.data = Uri.fromParts("package", context.packageName, null)
                return intent
            } catch (e: Exception) {
                e.printStackTrace()
            }
            //系统设置权限
            return Intent(Settings.ACTION_SETTINGS)
        }
    }

}